package com.circle.interests.biz.enums;

import lombok.Getter;

/**
 * @author zhou
 * @date 2021/1/15
 */
public enum SceneTypeEnum {
    /**
     * 奖品发放编码
     */
    ACT(1, "活动"),
    CLUEMGR(2, "线索管家");

    @Getter
    private final Integer code;
    @Getter
    private final String info;

    SceneTypeEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public static SceneTypeEnum getByCode(Integer code) {
        return getByCode(code, null);
    }

    public static SceneTypeEnum getByCode(Integer code, SceneTypeEnum defaultValue) {
        for (SceneTypeEnum e : SceneTypeEnum.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        return defaultValue;
    }
}
